package com.fs.web.yz.utils;

import com.fs.common.pojo.RecipesTemplate;

import java.util.Comparator;

public class RecipesTemplateComparator implements Comparator<RecipesTemplate> {

    @Override
    public int compare(RecipesTemplate o1, RecipesTemplate o2) {
        Double o1type = Double.parseDouble(o1.getType());
        Double o2type = Double.parseDouble(o2.getType());
        if (o1type > o2type){
            return -1;
        }else if (o1type < o2type){
            return 1;
        }else {
            return 0;
        }
    }
}
